package aop;

import com.bjsxt.model.User;
import com.bjsxt.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by germmy on 17/5/27.
 */
public class AppConfig {


    public  static  void main(String args[]){
//        ApplicationContext context =
//                new AnnotationConfigApplicationContext(AppConfig.class);
//        MachineKiller mk=context.getBean(MachineKiller.class);
//        mk.kill();
//        System.out.println("main...");


        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("application.xml");
        MachineKiller mk = (MachineKiller)ctx.getBean("machineKiller");
        mk.kill();
        System.out.println("###");
        ctx.destroy();

    }


}
